<ul class="media-list thread-list">
  {% for thread in threads %}
    {% set group = groups[thread.groupId]|default(null) %}
    {% if users|default(null) %}
    {% set user = users[thread.userId]|default(null) %}
    {% endif %}
    <li class="media">
      <div class="media-left">
        <span class="reply-num">
         <strong>{% if thread.postNum %} {{thread.postNum}} {% else %} 0 {% endif %}</strong> {{'thread.reply'|trans}}
        </span>
      </div>
      <div class="media-body pts">
        <div class="media-heading">
         <a class="title gray-darker" href="{{ path('group_thread_show', {id:thread.groupId, threadId:thread.id}) }}">{{thread.title|sub_text(90)}}</a>
          {% if thread.isStick %}
            <span class="label label-primary">{{'thread.status.stick'|trans}}</span>
          {% endif %}
          {% if thread.isElite %}
            <span class="label label-danger">{{'thread.status.essence'|trans}}</span>
          {% endif %}

          {% if is_feature_enabled('group_reward') %}
            {% if thread.type == 'reward' and thread.rewardCoin > 0 %}
              <span class="label label-danger">{{'thread.status.reward'|trans}}</span>
            {% endif %}
          {% endif %}
        </div>

        <div class="metas">
          {{ web_macro.user_avatar(user, 'userImg', 'avatar-xxs') }}
          {{ web_macro.user_link(user ,'pls') }}{{'thread.create'|trans}}
          <span class="divider">•</span>
          {{thread.createdTime|smart_time}}
          {% if group %}
          <span class="divider">•</span>
          <a class="gray-darker" href="{{path('group_show',{id:thread.groupId})}}" title="{{ group.title }}" >{{ group.title }}</a>
          {% endif %}
          {% if thread.lastPostTime %}
            <span class="divider">•</span>
            {{'thread.last_reply'|trans}} {{ web_macro.user_link(lastPostMembers[thread.lastPostMemberId] , 'color-gray') }}
            <span class="divider">•</span>
            {{ thread.lastPostTime|smart_time}}
          {% endif %}
        </div>
      </div>
    </li>
  {% else %}
    <li class="empty">{{'thread.empty'|trans}}</li>
  {% endfor %}
</ul>
